<template>
  <div>
    <MessageWinComponent ref="result-win"/>
    <ButtonBarRowComponent>
      <div class="tag-scan-span">
        <p style="color: red">* 本工具只扫描了《新内容.txt》截至2022-03-02维护内容，如需添加请联系xiujq19571</p>
        <p style="color: red">* SVN提交历史可能较多，请耐心等待，如果请求失败，会有弹窗提示</p>
      </div>
      <ToolBarComponent ref="tag-scan-input">
        <InputComponent input-lable="tags银行简写" input-name="bankName"/>
        <InputComponent input-lable="tags提交人员" input-name="commitAuthor" default-value="zhengsw15748,liumj17281,liutao08984" :input-width="500"/>
      </ToolBarComponent>
      <Button text="执行扫描" :click-function="tagsScan"/>
    </ButtonBarRowComponent>
  </div>
</template>

<script>
import ToolBarComponent from "@/components/toolbar/ToolBarComponent";
import InputComponent from "@/components/input/InputComponent";
import Button from "@/components/button/ButtonComponent";
import {postRequest} from "@/axio2";
import MessageWinComponent from "@/components/win/MessageWinComponent";
import ButtonBarRowComponent from "@/components/button/ButtonBarRowComponent";

export default {
  name: "TagsScan",
  components: {ButtonBarRowComponent, MessageWinComponent, Button, InputComponent, ToolBarComponent},
  methods:{
    tagsScan(){
      let param = this.$refs["tag-scan-input"].getSubmitParams();
      postRequest(
          "svnkit/tagScan.do",
          param,
          this.successCallBack,
          this.failCallBack,
          this
      );
    },
    successCallBack(response,component){
      component.$refs["result-win"].setMessage("文件名："+response.data.errorMsg+"，请去SQL自动生成路径下寻找对应文件");
      component.$refs["result-win"].showWin();
    },
    failCallBack(response,component){
      component.$refs["result-win"].setMessage("生成失败");
      component.$refs["result-win"].showWin();
    }
  }
}
</script>

<style scoped>
.tag-scan-span{
  margin-bottom: 20px;
}
</style>